import requests

url = "https://fanyi.baidu.com/basetrans"

query_string = {"query":"你好，世界",
                "from":"zh",
                "to":"en",
                "token": "c5f5c3fb293921eb14de378fb4315838",
                "sign":"289133.35420"}

headers = {
    "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
    # "Referer": "https://fanyi.baidu.com/?aldtype=16047"
}

response = requests.post(url,data=query_string,headers=headers)
response.encoding = "utf-8"
# print(response.text)

print(response.content.decode())
# print(type(response.content.decode()))
